package com.core.family.biz.yizhao.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.family.biz.yizhao.domain.po.YzPriceItem;
import com.core.family.biz.yizhao.mapper.YzPriceItemMapper;
import com.core.family.biz.yizhao.service.YzPriceItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;

import com.core.common.gen.BaseServiceImpl;



/**
 * @author honglei
 * @version 1.0
 * @time: 2023-7-7 23:20:46
 * @Description 服务实现层 
 */
@Slf4j
@Service
public class YzPriceItemServiceImpl extends BaseServiceImpl<YzPriceItemMapper, YzPriceItem> implements YzPriceItemService {


    @Override
    public List<YzPriceItem> getByPriceId(Integer id) {
        if (id==null){
            return null;
        }
        LambdaQueryWrapper<YzPriceItem> wrapper=Wrappers.lambdaQuery();
        wrapper.eq(YzPriceItem::getPriceId,id);
        return this.baseMapper.selectList(wrapper);
    }

    @Override
    public boolean removeByPriceId(Integer id) {
        if (id==null){
            return true;
        }
        LambdaQueryWrapper<YzPriceItem> wrapper=Wrappers.lambdaQuery();
        wrapper.eq(YzPriceItem::getPriceId,id);
        this.baseMapper.delete(wrapper);
        return true;
    }
}

